<?php

defined('SYSTEM_PATH') or die('Han che truy cap');

class MVCBase extends Loader
{

    /**
     * Library should be a static class (helper class); One class per file.
     * @param  $libName Library Name
     * @return void
     */
    protected function loadLibrary($libName)
    {
        $libName = strtolower($libName);
        //First, we look into application library folder
        $path = APP_PATH . 'libraries' . DS . $libName . '.library.php';
        if(!$this->loadClass($libName,$path,FALSE))
        {
            //application lib not found ? search for system lib
            $path = SYSTEM_PATH . 'libraries' . DS . $libName . '.library.php';
            if(!$this->loadClass($libName,$path,FALSE))
                exit("Library $libName does not exist !!");
        }
    }
}